package com.yonyou.cyxdms.sysAuth.service.task;

import com.yonyou.cyxdms.sysAuth.service.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class SysmanageTask {

    //日志对象
    private static final Logger logger = LoggerFactory.getLogger(SysmanageTask.class);

    @Autowired
    private UserService userService;

    /**
     * 将所有的failureNum改为0
     *
     * @author 李贺
     * @date 2019年11月19日
     */
    @Scheduled(cron = "0 0 0 * * ?")
    public void updateFailureNum() {
        Long count = userService.updateFailureNum();
        logger.info("将所有的failureNum改为0,更改人数为"+count);
    }
}
